/**
 * @description Vuex状态管理
 * @author 刘永奇
 */
import { defineStore } from "pinia";
import storage from "../utils/storage";

export const useUserInfoStore = defineStore("userInfoStore", {
  state: () => ({
    userInfo: storage.getItem("userInfo") || {},
  }),
  actions: {
    setUserInfo(userInfo) {
      this.userInfo = userInfo;
      storage.setItem("userInfo", userInfo);
    },
  },
});

// import { createStore } from "vuex";
// import mutations from "./mutations";
// import storage from "./../utils/storage";
// const state = {
//   userInfo: storage.getItem("userInfo") || {},
//   menuList: storage.getItem("menuList") || [],
// };

// export default createStore({
//   state,
//   mutations,
// });
